<template>
    <div>
    <div
      class="col-md-12"
      style="border-top: 1px solid #ccc; border-bottom: 1px solid #ccc"
    >
        <el-col :span="16" style="padding-left: 20px">
          <el-tooltip
            class="item"
            effect="dark"
            content="选择要显示的列"
            placement="top"
          >
            <el-popover placement="bottom" width="300" trigger="click">
              <el-col :span="12">
                <el-checkbox
                  v-model="showCustomerCode"
                  @change="showHide('showCustomerCode')"
                  >客户代码
                </el-checkbox>
              </el-col>
              <el-col :span="12">
                <el-checkbox
                  v-model="showCustomerStatus"
                  @change="showHide('showCustomerStatus')"
                  >客户状态
                </el-checkbox>
              </el-col>
              <el-col :span="12">
                <el-checkbox
                  v-model="showCustomerCate"
                  @change="showHide('showCustomerCate')"
                  >客户类别
                </el-checkbox>
              </el-col>
              <el-col :span="12">
                <el-checkbox
                  v-model="showCreditRank"
                  @change="showHide('showCreditRank')"
                  >客户信用等级
                </el-checkbox>
              </el-col>
              <el-col :span="12">
                <el-checkbox
                  v-model="showCreditLine"
                  @change="showHide('showCreditLine')"
                  >授信额度
                </el-checkbox>
              </el-col>
              <el-col :span="12">
                <el-checkbox
                  v-model="showCapital"
                  @change="showHide('showCapital')"
                  >注册资金</el-checkbox
                >
              </el-col>
              <el-col :span="12">
                <el-checkbox
                  v-model="showAnnualSales"
                  @change="showHide('showAnnualSales')"
                  >年销售额
                </el-checkbox>
              </el-col>
              <el-col :span="12">
                <el-checkbox v-model="showBank" @change="showHide('showBank')"
                  >对公银行账号</el-checkbox
                >
              </el-col>
              <el-col :span="12">
                <el-checkbox
                  v-model="showCertificateNo"
                  @change="showHide('showCertificateNo')"
                  >开户银行
                </el-checkbox>
              </el-col>
              <el-col :span="12">
                <el-checkbox
                  v-model="showAddress"
                  @change="showHide('showAddress')"
                  >税务登记证号
                </el-checkbox>
              </el-col>
              <el-col :span="12">
                <el-checkbox v-model="showArea" @change="showHide('showArea')"
                  >地址</el-checkbox
                >
              </el-col>
              <el-col :span="12">
                <el-checkbox v-model="showBrand" @change="showHide('showBrand')"
                  >经营面积</el-checkbox
                >
              </el-col>
              <el-col :span="12">
                <el-checkbox
                  v-model="showBankAccount"
                  @change="showHide('showBankAccount')"
                  >模拟，对应列表的列项
                </el-checkbox>
              </el-col>
              <el-button
                size="small"
                slot="reference"
                type="plain"
                class="setting"
              >
                <div style="display: flex; flex-direction: column">
                  <i class="el-icon-setting"></i>
                  <span style="margin-top: 3px">显示设置</span>
                </div>
              </el-button>
            </el-popover>
          </el-tooltip>

          <el-button
            @click="handleImport(3)"
            size="small"
            style="margin-top: 10px; margin-bottom: 10px; margin-left: 10px"
            type="plain"
            class="setting"
          >
            <div style="display: flex; flex-direction: column">
              <i class="el-icon-setting"></i>
              <span style="margin-top: 3px">上报审批</span>
            </div>
          </el-button>
          <el-input
            placeholder
            v-model="inputSearch"
            class="input-with-select input-search"
            style="margin-left: 10px; width: 450px; height: 47px; top: 9px"
            speech
            x-webkit-speech
            size="large"
          >
            <el-select
              v-model="selectsearch"
              slot="prepend"
              placeholder="请选择"
            >
              <el-option label="标题" value="1"></el-option>
              <el-option label="类型" value="2"></el-option>
              <el-option label="申请人" value="3"></el-option>
              <el-option label="审核状态" value="4"></el-option>
              <el-option label="审核人" value="7"></el-option>
              <el-option label="序号id" value="5"></el-option>
            </el-select>
            <i slot="prefix" class="iconfont iconpaizhao1"></i>

            <el-button slot="append" icon="el-icon-search" style="height: 47px"
              >查询</el-button
            >
          </el-input>
        </el-col>



      <el-col :span="8">
        <el-button
          size="small"
          style="
            margin-top: 10px;
            margin-bottom: 10px;
            float: right;
            margin-left: 10px;
          "
          type="plain"
          class="setting"
        >
          <div style="display: flex; flex-direction: column">
            <i class="el-icon-setting"></i
            ><span style="margin-top: 3px">打印</span>
          </div>
        </el-button>

        <el-button
          @click="handleImport(2)"
          size="small"
          style="margin-top: 10px; margin-bottom: 10px; float: right"
          type="plain"
          class="setting"
        >
          <div style="display: flex; flex-direction: column">
            <i class="el-icon-setting"></i
            ><span style="margin-top: 3px">导出</span>
          </div>
        </el-button>
        <el-button
          @click="handleImport(1)"
          size="small"
          style="margin-top: 10px; margin-bottom: 10px; float: right"
          type="plain"
          class="setting"
        >
          <div style="display: flex; flex-direction: column">
            <i class="el-icon-setting"></i
            ><span style="margin-top: 3px">导入</span>
          </div>
        </el-button>
        <el-tooltip
          class="item"
          effect="dark"
          content="操作：选择下面列表，然后点击按钮"
          placement="top"
        >
          <el-button
            @click="handleDelCustomer(1)"
            size="small"
            style="margin-top: 10px; margin-bottom: 10px; float: right"
            type="plain"
            class="setting"
          >
            <div style="display: flex; flex-direction: column">
              <i class="el-icon-setting"></i
              ><span style="margin-top: 3px">删除</span>
            </div>
          </el-button>
        </el-tooltip>
        <el-button
          @click="handleSelectionChange"
          size="small"
          style="margin-top: 10px; margin-bottom: 10px; float: right"
          type="plain"
          class="setting"
        >
          <div style="display: flex; flex-direction: column">
            <i class="el-icon-setting"></i
            ><span style="margin-top: 3px">新建</span>
          </div>
        </el-button>
      </el-col>
    </div>




        <el-table
                ref="multipleTable"
                :data="tableData"
                show-summary
                border
                stripe
                height="600"
                row-class-name="tableRow"
                header-row-class-name="tableHeader"
                @row-dblclick="handleSelectionChange"
                style="width: 100%;border-top:1px solid #c5c5c5;">
            <el-table-column
                    type="selection"
                    width="55">
            </el-table-column>
            <el-table-column
                    prop="id"
                    label="序号"
                    width="50">
            </el-table-column>
            <el-table-column
                    prop="date"
                    label="录入日期
"
                    width="150">
            </el-table-column>
            <el-table-column
                    prop="id"
                    label="审批单号"
                    width="150">
            </el-table-column>
            <el-table-column
                    prop="type"
                    label="审批类型
"
                    width="150">
            </el-table-column>
            <el-table-column
                    prop="spzt"
                    label="审批状态
"
                    width="150">
            </el-table-column>
            <el-table-column
                    prop="bt"
                    label="标题
"
                    width="120">
            </el-table-column>
            <el-table-column
                    prop="dj"
                    label="等级

"
                    width="120">
            </el-table-column>
            <el-table-column
                    prop="jzrq"
                    label="截止日期

"
                    width="120">
            </el-table-column>
            <el-table-column
                    prop="bm"
                    label="部门
"
                    width="120">
            </el-table-column>
            <el-table-column
                   
                    prop="province"
                    label="职位
"
                    width="120">
            </el-table-column>
            <el-table-column
                   
                    prop="city"
                    label="提交人
"
                    width="120">
            </el-table-column>
            <el-table-column
                   
                    prop="address"
                    label="审批人
"
                    width="300 ">
            </el-table-column>

            <el-table-column
                    v-if="showCreditLine"
                    prop="zip"
                    label="时间
"
                    width="120">
            </el-table-column>

            <el-table-column
                    v-if="showCapital"
                    prop="zip"
                    label="备注
"
                    width="120">
            </el-table-column>
        </el-table>


        <el-dialog id="customerDialog" title="请假审批" :visible.sync="dialogCostoms"
                   width="90%"
                   top="10vh"
                   :fullscreen="fullscreen"
        >
            <dialog-tools
                    v-bind:back="true"
                    v-bind:next="true"
                    v-bind:goback="true"
                    v-bind:prev="true"
                    v-bind:screen="true"
                    @clickfullscreen="clickfullscreen"
            >

            </dialog-tools>
            <el-form size="mini" :model="customer" label-width="100px">
                <el-form-item label="审批类型" prop="name">
                    <el-input value="请假审批" disabled auto-complete="off" class="clientName"></el-input>
                </el-form-item>

                <el-form-item label="审批单号">
                    <el-input value="123" disabled auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="申请人">
                    <el-input value="张三-镶嵌部门" disabled auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="申请天数">
                    <el-input value="10" disabled auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="开始时间">
                    <el-input value="2019-04-01 09:00" disabled auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="结束时间">
                    <el-input value="2019-04-10 09:00" disabled auto-complete="off"></el-input>
                </el-form-item>


                <el-form-item label="请假原因">
                    <el-input value="事假" disabled auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="备注">
                    <el-input v-model="customer.address" auto-complete="off"></el-input>
                </el-form-item>


                <el-form-item label="审批人">
                    <el-input value="吴先生" disabled auto-complete="off"></el-input>
                </el-form-item>


                <el-form-item label="审批结果">

                    <el-select v-model="customer.annualsales" placeholder="请选择类型">
                        <el-option label="同意" value="1"></el-option>
                        <el-option label="不同意" value="2"></el-option>
                    </el-select>

                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="dialogCostoms = false">取 消</el-button>
                <el-button type="primary" @click="dialogAdd">确定提交审核</el-button>
            </div>
        </el-dialog>


        <el-dialog id="customerDialog2" title="出差审批" :visible.sync="dialogCostoms2"
                   style="display:none;"
                   width="90%"
                   top="10vh"
                   :fullscreen="fullscreen"
        >
            <dialog-tools
                    v-bind:back="true"
                    v-bind:next="true"
                    v-bind:goback="true"
                    v-bind:prev="true"
                    v-bind:screen="true"
                    @clickfullscreen="clickfullscreen"
            >

            </dialog-tools>
            <el-form size="mini" :model="customer" label-width="100px">
                <el-form-item label="审批类型" prop="name">
                    <el-input value="出差审批" disabled auto-complete="off" class="clientName"></el-input>
                </el-form-item>

                <el-form-item label="审批单号">
                    <el-input value="123" disabled auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="申请人">
                    <el-input value="123" disabled auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="申请天数">
                    <el-input value="10" disabled auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="开始时间">
                    <el-input value="2019-04-01 09:00" disabled auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="结束时间">
                    <el-input value="2019-04-10 09:00" disabled auto-complete="off"></el-input>
                </el-form-item>


                <el-form-item label="出差原因">
                    <el-input value="出差" disabled auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="备注">
                    <el-input value="费用备注" auto-complete="off"></el-input>
                </el-form-item>


                <el-form-item label="审批人">
                    <el-input value="吴先生" disabled auto-complete="off"></el-input>
                </el-form-item>


                <el-form-item label="审批结果">

                    <el-select v-model="customer.annualsales" placeholder="请选择类型">
                        <el-option label="同意" value="1"></el-option>
                        <el-option label="不同意" value="2"></el-option>
                    </el-select>

                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="dialogCostoms2 = false">取 消</el-button>
                <el-button type="primary" @click="dialogCostoms2 = false">确定提交审核</el-button>
            </div>
        </el-dialog>

        <el-dialog id="customerDialog3" title="借销审批" :visible.sync="dialogCostoms3" style="display:none;"
                   width="90%"
                   top="10vh"
                   :fullscreen="fullscreen"
        >
            <dialog-tools
                    v-bind:back="true"
                    v-bind:next="true"
                    v-bind:goback="true"
                    v-bind:prev="true"
                    v-bind:screen="true"
                    @clickfullscreen="clickfullscreen"
            >

            </dialog-tools>
            <el-form size="mini" :model="customer" label-width="100px">
                <el-form-item label="审批类型" prop="name">
                    <el-input value="借销审批" disabled auto-complete="off" class="clientName"></el-input>
                </el-form-item>

                <el-form-item label="审批单号">
                    <el-input value="133" disabled auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="申请人">
                    <el-input value="133" disabled auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="借款金额">
                    <el-input value="100" disabled auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="申请天数">
                    <el-input value="10" disabled auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="开始时间">
                    <el-input value="2019-04-01 09:00" disabled auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="结束时间">
                    <el-input value="2019-04-10 09:00" disabled auto-complete="off"></el-input>
                </el-form-item>


                <el-form-item label="借销原因">
                    <el-input value="借销" disabled auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="备注">
                    <el-input value="费用备注" auto-complete="off"></el-input>
                </el-form-item>


                <el-form-item label="审批人">
                    <el-input value="吴先生" disabled auto-complete="off"></el-input>
                </el-form-item>


                <el-form-item label="审批结果">

                    <el-select v-model="customer.annualsales" placeholder="请选择类型">
                        <el-option label="同意" value="1"></el-option>
                        <el-option label="不同意" value="3"></el-option>
                    </el-select>

                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="dialogCostoms3 = false">取 消</el-button>
                <el-button type="primary" @click="dialogCostoms3 = false">确定提交审核</el-button>
            </div>
        </el-dialog>


        <el-dialog id="customerDialog4" title="报价审批" :visible.sync="dialogCostoms4" style="display:none;"
                   width="90%"
                   top="10vh"
                   :fullscreen="fullscreen"
        >
            <dialog-tools
                    v-bind:back="true"
                    v-bind:next="true"
                    v-bind:goback="true"
                    v-bind:prev="true"
                    v-bind:screen="true"
                    @clickfullscreen="clickfullscreen"
            >

            </dialog-tools>
            <el-form size="mini" :model="customer" label-width="100px">
                <el-form-item label="审批类型" prop="name">
                    <el-input value="报价审批" disabled auto-complete="off" class="clientName"></el-input>
                </el-form-item>

                <el-form-item label="审批单号">
                    <el-input value="144" disabled auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="申请人">
                    <el-input value="144" disabled auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="报价总金额">
                    <el-input value="100" disabled auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="客户名称">
                    <el-input value="气温" disabled auto-complete="off"></el-input>
                </el-form-item>


                <el-form-item label="备注">
                    <el-input value="费用备注" auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="附件">
                    <el-button type="plain">报价单详情下载查看</el-button>
                </el-form-item>


                <el-form-item label="审批人">
                    <el-input value="吴先生" disabled auto-complete="off"></el-input>
                </el-form-item>


                <el-form-item label="审批结果">

                    <el-select v-model="customer.annualsales" placeholder="请选择类型">
                        <el-option label="同意" value="1"></el-option>
                        <el-option label="不同意" value="4"></el-option>
                    </el-select>

                </el-form-item>

                <el-form-item label="审批备注">
                    <el-input value="备注" auto-complete="off"></el-input>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="dialogCostoms4 = false">取 消</el-button>
                <el-button type="primary" @click="dialogCostoms4 = false">确定提交审核</el-button>
            </div>
        </el-dialog>

        <el-dialog id="customerDialog5" title="订单审批" :visible.sync="dialogCostoms5" style="display:none;"
                   width="90%"
                   top="10vh"
                   :fullscreen="fullscreen"
        >
            <dialog-tools
                    v-bind:back="true"
                    v-bind:next="true"
                    v-bind:goback="true"
                    v-bind:prev="true"
                    v-bind:screen="true"
                    @clickfullscreen="clickfullscreen"
            >

            </dialog-tools>
            <el-form size="mini" :model="customer" label-width="100px">
                <el-form-item label="审批类型" prop="name">
                    <el-input value="订单审批" disabled auto-complete="off" class="clientName"></el-input>
                </el-form-item>

                <el-form-item label="审批单号">
                    <el-input value="155" disabled auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="申请人">
                    <el-input value="155" disabled auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="订单总金额">
                    <el-input value="100" disabled auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="客户名称">
                    <el-input value="气温" disabled auto-complete="off"></el-input>
                </el-form-item>


                <el-form-item label="备注">
                    <el-input value="费用备注" auto-complete="off"></el-input>
                </el-form-item>

                <el-form-item label="附件">
                    <el-button type="plain">订单单详情下载查看</el-button>
                </el-form-item>


                <el-form-item label="审批人">
                    <el-input value="吴先生" disabled auto-complete="off"></el-input>
                </el-form-item>


                <el-form-item label="审批结果">

                    <el-select v-model="customer.annualsales" placeholder="请选择类型">
                        <el-option label="同意" value="1"></el-option>
                        <el-option label="不同意" value="5"></el-option>
                    </el-select>

                </el-form-item>

                <el-form-item label="审批备注">
                    <el-input value="备注" auto-complete="off"></el-input>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="dialogCostoms5 = false">取 消</el-button>
                <el-button type="primary" @click="dialogCostoms5 = false">确定提交审核</el-button>
            </div>
        </el-dialog>

        <change-customer v-bind:dialogshow="dialogChangeCustomer" @dialog_close="change_customer_dialog_close"></change-customer>

        <send-message v-bind:dialogshow="dialogSendMessage" @dialog_close="send_message_dialog_close"></send-message>
        <send-weixin v-bind:dialogshow="dialogWeixin" @dialog_close="send_weixin_dialog_close"></send-weixin>
        <send-email v-bind:dialogshow="dialogEmail" @dialog_close="send_email_dialog_close"></send-email>
    </div>
</template>

<style>
    .col-md-12 {
        display: block;
        overflow: hidden;
        background-color: #f5f5f5;
    }

    .tableHeader th {
        background-color: #f5f5f5 !important;
        /*color: #000000;*/
        /*border-color: #c5c5c5;*/
    }

    .el-tabs__content {
        padding: 0px !important;
    }

    .ml-10 {
        margin-left: 10px;
    }

    .mg-10 {
        margin: 10px;
    }

    .mr-10 {
        margin-right: 10px;
    }

    #customerDialog .el-dialog__body .el-form-item {
        width: 45%;
        float: left;
        margin-bottom: 5px;
    }

    #customerDialog .el-dialog__body .el-form-item:nth-child(odd) {
        float: right;
    }

    #customerDialog .el-dialog__footer {
        clear: both;
    }

    .tableRow {
        cursor: pointer;
    }
</style>

<script>
  module.exports = {
    methods: {
      handleClick (row) {
        console.log(row)
      },
      handleSelectionChange (val) {
        console.log(val)
        //显示弹框
        console.log(333)
        if(val.id === '1'){
          this.dialogCostoms = true
        }else if(val.id === '2'){
          this.dialogCostoms2 = true
        }else if(val.id === '3'){
          this.dialogCostoms3 = true
        }else if(val.id === '4'){
          this.dialogCostoms4 = true
        }else if(val.id === '5'){
          this.dialogCostoms5 = true
        }
      },

      openChangeCustomerDialog (val) {
        this.dialogCostomsChange = true
      },

      handleDelCustomer(val){
        // 删除操作
        this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.$message({
            type: 'success',
            message: '删除成功!'
          });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消操作'
          });
        });

      },

      handleImport(val){
        if (val === 1) {
          //导入操作
          this.$alert('打开文件夹导入工作', '导入', {
            confirmButtonText: '确定',
            callback: action => {
              this.$message({
                type: 'success',
                message: '导入成功'
              });
            }
          });
        }else{
          //导出操作
          this.$alert('打开文件夹导出工作', '导出', {
            confirmButtonText: '确定',
            callback: action => {
              this.$message({
                type: 'success',
                message: '导出表格成功'
              });
            }
          });
        }
      },

      handleButtons(val){
        switch(val){
          case 1:
            this.dialogSendMessage = 'true'
            console.log(this.dialogSendMessage)
            break;
          case 2:
            this.dialogWeixin = 'true'
            console.log(this.dialogWeixin)
            break;
          case 3:
            this.dialogEmail = 'true'
            console.log(this.dialogEmail)
            break;
          case 4:
            this.dialogChangeCustomer = 'true'
            console.log(this.dialogChangeCustomer)
            break;
          case 6:
            this.$confirm('是否继续操作?', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              this.$message({
                type: 'success',
                message: '操作成功!'
              })
            }).catch(() => {
              this.$message({
                type: 'info',
                message: '已取消'
              })
            })

            break;
        }

      },
      handleChangeCustomer(val){
        this.dialogChangeCustomer = 'true'
        console.log(this.dialogChangeCustomer)
      },
      dialogAdd () {
        console.log(123)
      },
      getSummaries (param) {
        const { columns, data } = param
        const sums = []
        columns.forEach((column, index) => {
          if (index === 0) {
            sums[index] = '总价'
            return
          }
          const values = data.map(item => Number(item[column.property]))
          if (!values.every(value => isNaN(value))) {
            sums[index] = values.reduce((prev, curr) => {
              const value = Number(curr)
              if (!isNaN(value)) {
                return prev + curr
              } else {
                return prev
              }
            }, 0)
            sums[index] += ' 元'
          } else {
            sums[index] = ''
          }
        })

        return sums
      },
      showHide (text) {
        console.log(text)
      },
      send_message_dialog_close(val){
        console.log(val)
        this.dialogSendMessage = false
      },
      send_weixin_dialog_close(val){
        this.dialogWeixin = false
      },
      send_email_dialog_close(val){
        this.dialogEmail = false
      },
      change_customer_dialog_close(val){
        console.log(val)
        this.dialogChangeCustomer = false
      },
      clickfullscreen () {
        this.fullscreen = !this.fullscreen
      },
    },

    data () {
      return {

        dialogCostoms: false,
        dialogCostoms2:false,
        dialogCostoms3:false,
        dialogCostoms4:false,
        dialogCostoms5:false,
        dialogCostoms6:false,
        dialogCostomsChange: false,
        dialogSendMessage:false,
        dialogWeixin:false,
        dialogEmail:false,
        dialogChangeCustomer:false,     //客户跟进
        customer: {
          name: '',
          customercode: '',
          customerstatus: '',
          customercate: '',
          creditrank: '',
          creditline: '',
          capital: '',
          annualsales: '',
          bank: '',
          certificateno: '',
          address: '',
          area: '',
          brand: '',
          bankaccount: '',
          trademark: '',
          website: '',
          lperson: '',
          lphone: '',
          contacts: '',

          phone: '',
          phonenum: '',
          weixin: '',
          email: '',
          fax: '',
          resource: '',
          requirement: '',
          ordercountmonth: '',
          purchaseamountmonth: '',
          ordercountyear: '',
          purchaseamountyear: '',
          customerstaffname: '',
          customerstaffcode: '',
          operator: '',
          insertime: '',
          remark: '',
        },

        form: {
          typeId: ''
        },

        select: {
          name: '',
          introduce: '',
          cooperative_brand: '',
          customer_status: '',
          customer_level: '',
          now_principal_id: '',
          last_follow_up_date: '',
          create_date: '',
        },

        crmsclientStatic: [
          { typename: 'A级' },
          { typename: 'B级' },
          { typename: 'C级' },
          { typename: 'D级' },
        ],

        crmsclientRank: [
          { typename: 'A类' },
          { typename: 'B类' },
          { typename: 'C类' },
          { typename: 'D类' },
        ],

        customerstaffs: [
          { typename: '客服1' },
          { typename: '客服2' },
          { typename: '客服3' },
          { typename: '客服4' },
        ],

        changeReason: [
          { typename: '交接原因一' },
          { typename: '交接原因二' },
          { typename: '交接原因三' },
          { typename: '其他' },
        ],

        options1: [],

        pickerOptions2: {
          shortcuts: [{
            text: '最近一周',
            onClick (picker) {
              const end = new Date()
              const start = new Date()
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
              picker.$emit('pick', [start, end])
            }
          }, {
            text: '最近一个月',
            onClick (picker) {
              const end = new Date()
              const start = new Date()
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
              picker.$emit('pick', [start, end])
            }
          }, {
            text: '最近三个月',
            onClick (picker) {
              const end = new Date()
              const start = new Date()
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
              picker.$emit('pick', [start, end])
            }
          }]
        },  //日期控件
        pickerOptions1: {
          disabledDate (time) {
            return time.getTime() > Date.now()
          },
          shortcuts: [{
            text: '今天',
            onClick (picker) {
              picker.$emit('pick', new Date())
            }
          }, {
            text: '昨天',
            onClick (picker) {
              const date = new Date()
              date.setTime(date.getTime() - 3600 * 1000 * 24)
              picker.$emit('pick', date)
            }
          }, {
            text: '一周前',
            onClick (picker) {
              const date = new Date()
              date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
              picker.$emit('pick', date)
            }
          }]
        }, //首次合作日期

        showCustomerCode: true,
        showCustomerStatus: true,
        showCustomerCate: true,
        showCreditRank: true,
        showCreditLine: true,
        showCapital: true,
        showAnnualSales: true,
        showBank: true,
        showCertificateNo: true,
        showAddress: true,
        showArea: true,
        showBrand: true,
        showBankAccount: true,
        showTrademark: true,
        showWebsite: true,
        showLperson: true,
        showLphone: true,
        showContacts: true,

        showPhone: true,
        showPhoneNum: true,
        showWeixin: true,
        showEmail: true,
        showFax: true,
        showResource: true,
        showRequirement: true,
        showOrderCountMonth: true,
        showPurchaseAmountMonth: true,
        showOrderCountYear: true,
        showPurchaseAmountYear: true,
        showCustomerStaffName: true,
        showCustomerStaffCode: true,
        showOperator: true,
        showInsertime: true,
        showRemark: true,


        tableData: [{
          date: '2016-05-02',
          id: '1',
          name: '王小虎',
          type: '请假审批',
          spzt:'待审批',
          province: 'BC1001',
          city: '合作中',
          address: 'A类',
          zip: ''
        }, {
          id: '2',
          date: '2016-05-04',
          name: '王小虎1',
          type: '出差审批',
          spzt:'待审批',
          province: 'BC1002',
          city: '未合作',
          address: 'A类',
          zip: ''
        }, {
          id: '3',
          date: '2016-05-01',
          name: '王小虎2',
                    type: '借销审批',
          spzt:'已审批',
          province: 'BC1003',
          city: '中断',
          address: 'A类',
          zip: ''
        }, {
          id: '4',
          date: '2016-05-03',
          name: '王小虎3',
                              type: '报价审批',
          spzt:'已审批',
          province: 'BC1004',
          city: '未合作',
          address: 'A类',
          zip: ''
        },
          , {
            id: '5',
            date: '2016-05-03',
            name: '王小虎3',
                                type: '订单审批',
          spzt:'已审批',
            province: 'BC1004',
            city: '未合作',
            address: 'A类',
            zip: ''
          }]
        ,
        multipleSelection: [],
        fullscreen: false,
      }
    },
    components: {
      // 将组建加入组建库
      'send-message': 'url:./send-message.vue',
      'send-weixin': 'url:./send-weixin.vue',
      'send-email': 'url:./send-email.vue',
      'change-customer': 'url:./change-customer.vue',

      'dialog-tools': 'url:./tools/dialog-tools.vue',
    },
  }
</script>
